/**
 * @Description:
 * @author 若琳
 * @date 2021/7/15
*/



const {MYSQL}  = require("../../../../../../../../ruoling-common/src/com/ruoling/common/config/mysqlconfig.js");

module.exports = class IndexService{


    /**
     * 渲染左侧菜单
     * @param callback
     * @returns {Promise<void>}
     * @constructor
     */
    static async LeftSideMenuService(callback){
        let  connect = null;

        try{
            connect = await MYSQL().connect();
            let obj = {
                sql:"select * from rl_sys_menu_permisson where Is_delete = 1 and sys_type = 'menu' and sys_available = 1 and sys_parent_id <> 0"
            };
            let list = await connect.connect_query_close(obj.sql);
            callback(null,list)

        }catch (e){

            if(connect != null){
                connect.close();
            }
            callback(e);
            return;
        }

    }
}